<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Whether another calendar is equal but for a different time</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="intlcalendar.indaylighttime.html">« IntlCalendar::inDaylightTime</a></li>
      <li style="float: right;"><a href="intlcalendar.islenient.html">IntlCalendar::isLenient »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.intlcalendar.html">IntlCalendar</a></li>
    <li>Whether another calendar is equal but for a different time</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="intlcalendar.isequivalentto" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">IntlCalendar::isEquivalentTo</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.5.0, PHP 7, PHP 8, PECL &gt;= 3.0.0a1)</p><p class="refpurpose"><span class="refname">IntlCalendar::isEquivalentTo</span> &mdash; <span class="dc-title">Whether another calendar is equal but for a different time</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-intlcalendar.isequivalentto-description">
  <h3 class="title">说明</h3>
  <p class="para">
   面向对象风格
  </p>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>IntlCalendar::isEquivalentTo</strong></span>(<span class="methodparam"><span class="type"><a href="class.intlcalendar.html" class="type IntlCalendar">IntlCalendar</a></span> <code class="parameter">$other</code></span>): <span class="type">bool</span></div>

  <p class="para rdfs-comment">
   过程化风格
  </p>
  <div class="methodsynopsis dc-description"><span class="methodname"><strong>intlcal_is_equivalent_to</strong></span>(<span class="methodparam"><span class="type"><a href="class.intlcalendar.html" class="type IntlCalendar">IntlCalendar</a></span> <code class="parameter">$calendar</code></span>, <span class="methodparam"><span class="type"><a href="class.intlcalendar.html" class="type IntlCalendar">IntlCalendar</a></span> <code class="parameter">$other</code></span>): <span class="type">bool</span></div>

  <p class="para rdfs-comment">
   Returns whether this and the given object are equivalent for all purposes
   except as to the time they have set. The locales do not have to match, as
   long as no change in behavior results from such mismatch. This includes the <a href="intlcalendar.gettimezone.html" class="link">timezone</a>, whether
   the <a href="intlcalendar.islenient.html" class="link">lenient mode</a> is set,
   the <a href="intlcalendar.getrepeatedwalltimeoption.html" class="link">repeated</a>
   and <a href="intlcalendar.getskippedwalltimeoption.html" class="link">skipped</a> wall time settings,
   the <a href="intlcalendar.getdayofweektype.html" class="link">days of the week when the
   weekend starts and ceases</a> and the <a href="intlcalendar.getweekendtransition.html" class="link">times where such transitions
   occur</a>. It may also include other calendar specific settings, such as
   the Gregorian/Julian transition instant.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-intlcalendar.isequivalentto-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt>
<code class="parameter">calendar</code></dt>

    <dd>

     <p class="para"><span class="classname"><a href="class.intlcalendar.html" class="classname">IntlCalendar</a></span> 实例。</p>
    </dd>

   
   
    <dt>
<code class="parameter">other</code></dt>

    <dd>

     <p class="para">
      The other calendar against which the comparison is to be made.
     </p>
    </dd>

   
  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-intlcalendar.isequivalentto-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Assuming there are no argument errors, returns <strong><code>true</code></strong> if the calendars are
   equivalent except possibly for their set time.
  </p>
 </div>



 <div class="refsect1 examples" id="refsect1-intlcalendar.isequivalentto-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-2411">
   <p><strong>示例 #1 <span class="function"><strong>IntlCalendar::isEquivalentTo()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$cal1&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">IntlCalendar</span><span style="color: #007700">::</span><span style="color: #0000BB">createInstance</span><span style="color: #007700">(</span><span style="color: #DD0000">'Europe/Lisbon'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'pt_PT'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$cal2&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">IntlCalendar</span><span style="color: #007700">::</span><span style="color: #0000BB">createInstance</span><span style="color: #007700">(</span><span style="color: #DD0000">'Europe/Lisbon'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'es_ES'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$cal2</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">clear</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$cal1</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">isEquivalentTo</span><span style="color: #007700">(</span><span style="color: #0000BB">$cal2</span><span style="color: #007700">));&nbsp;</span><span style="color: #FF8000">//&nbsp;true<br /><br /></span><span style="color: #0000BB">$cal3&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">IntlCalendar</span><span style="color: #007700">::</span><span style="color: #0000BB">createInstance</span><span style="color: #007700">(</span><span style="color: #DD0000">'Europe/Lisbon'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'en_US'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$cal1</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">isEquivalentTo</span><span style="color: #007700">(</span><span style="color: #0000BB">$cal3</span><span style="color: #007700">));&nbsp;</span><span style="color: #FF8000">//&nbsp;false<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$cal1</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getFirstDayOfWeek</span><span style="color: #007700">(),&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;2&nbsp;(Monday)<br /></span><span style="color: #0000BB">$cal3</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getFirstDayOfWeek</span><span style="color: #007700">());&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;1&nbsp;(Sunday)</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
bool(true)
bool(false)
int(2)
int(1)
</pre></div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-intlcalendar.isequivalentto-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="methodname"><a href="intlcalendar.equals.html" class="methodname" rel="rdfs-seeAlso">IntlCalendar::equals()</a> - Compare time of two IntlCalendar objects for equality</span></li>
   </ul>
  </p>
 </div>


</div></div></div></body></html>